package com.xsh.opensltest.ui;

import android.app.AlertDialog;
import android.content.Context;
import android.graphics.Canvas;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import com.xsh.opensltest.R;

// 钢琴窗帘 仿FL studio
public class PianoRoll extends View
{
    private LinearLayout toolBar;
    private Button RiffButton;
    public PianoRoll(Context context) {
        super(context);
        toolBar = new LinearLayout(context);
        RiffButton = new Button(context);
        RiffButton.setText("riff");
        RiffButton.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View view)
            {
                AlertDialog.Builder builder = new AlertDialog.Builder(context);
                builder.setCancelable(false);
                builder.setTitle("钢琴卷帘-riff器");
                builder.setView(R.layout.dialog_riff);
                builder.create();
                builder.show();
            }
        });
    }

    @Override
    protected void onDraw(Canvas canvas)
    {
        super.onDraw(canvas);
        //drawHenXian();
        //drawHenXian();
    }
    private void drawShuXian(Canvas canvas)
    {
        float x1,y1,x2,y2;
        // Y 轴表示音高（通常是 C0 ~ B8，共 128 个 MIDI 音符）。
        for(int i=0;i<128;i+=10)
        {
           // canvas.drawLine();
        }
    }
    private void drawHenXian(Canvas canvas)
    {
        //时间轴（X 轴）
        float x1,y1,x2,y2;
        for(int i=0;i<1920;i+=16)
        {
            //canvas.drawLine();
        }
    }

}
